﻿package Cain
{
	import flash.display.Sprite;
	import caurina.transitions.Tweener;
	import caurina.transitions.properties.FilterShortcuts;

	public class wd_acc 
	{
		public static function alpha_0(mc:Sprite):void 
		{
			var _n:int = mc.numChildren;
			mc.alpha = 1;
			for (var i:int = 0; i < _n; i++) 
			{
				mc.getChildAt(i).alpha = 0;
			}
		}
		public static function FilterShortcuts_init():void 
		{
			FilterShortcuts.init();
		}
		//============================================================================================================================= alpha
		public static function alpha_in(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,syle:String = "easeOutCubic"):void 
		{
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function alpha_in_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,syle:String = "easeOutCubic"):void 
		{
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		public static function alpha_out(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,syle:String = "easeOutCubic"):void 
		{
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function alpha_out_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,syle:String = "easeOutCubic"):void 
		{
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		//============================================================================================================================= blur
		public static function blur_in(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blur:int = 30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blur,_Blur_blurY:blur,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function blur_in_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blur:int = 30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blur,_Blur_blurY:blur,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
	
		}
		public static function blur_out(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blur:int = 30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blur,_Blur_blurY:blur,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function blur_out_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blur:int = 30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blur,_Blur_blurY:blur,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		//============================================================================================================================= fly
		public static function fly_in(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,fly:int = -30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blurX,_Blur_blurY:blurY,y:mc.getChildAt(i).y+fly,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,y:mc.getChildAt(i).y-fly,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function fly_in_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,fly:int = -30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blurX,_Blur_blurY:blurY,y:mc.getChildAt(i).y+fly,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,y:mc.getChildAt(i).y-fly,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		public static function fly_out(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,fly:int = -30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blurX,_Blur_blurY:blurY,y:mc.getChildAt(i).y+fly,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function fly_out_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,fly:int = -30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blurX,_Blur_blurY:blurY,y:mc.getChildAt(i).y+fly,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		//============================================================================================================================= move
		public static function move_in(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,move:int = 30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blurX,_Blur_blurY:blurY,x:mc.getChildAt(i).x+move,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,x:mc.getChildAt(i).x-move,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function move_in_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,move:int = 30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			alpha_0(mc);
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {_Blur_blurX:blurX,_Blur_blurY:blurY,x:mc.getChildAt(i).x+move,_Blur_quality:1} );
			}
			for (i = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:1,_Blur_blurX:0,_Blur_blurY:0,x:mc.getChildAt(i).x-move,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		public static function move_out(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,move:int = 30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blurX,_Blur_blurY:blurY,x:mc.getChildAt(i).x+move,_Blur_quality:1,time:time,delay:dy+wait*(_n-i),transition:syle} );
			}
		}
		public static function move_out_re(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,move:int = 30,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			FilterShortcuts_init();
			var _n:int = mc.numChildren;
			for (var i:int = 0; i < _n; i++) 
			{
				Tweener.addTween(mc.getChildAt(i), {alpha:0,_Blur_blurX:blurX,_Blur_blurY:blurY,x:mc.getChildAt(i).x+move,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
			}
		}
		//============================================================================================================================= random
		public static function random_in(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			var _n:int = mc.numChildren;
			alpha_0(mc);
			var _arr:Array = new Array();
			for (var i:int = 0; i < _n; i++) 
			{
				_arr.push(mc.getChildAt(i));
			}
			_arr = arr_acc.random(_arr);
			if (blurX != 0||blurY != 0)
			{
				
				FilterShortcuts_init();
				for (i = 0; i < _n; i++) 
				{
					Tweener.addTween(_arr[i], {_Blur_blurX:blurX,_Blur_blurY:blurY,_Blur_quality:1} );
				}
				for (i = 0; i < _n; i++) 
				{
					Tweener.addTween(_arr[i], {alpha:1,_Blur_blurX:0,_Blur_blurY:0,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
				}
			}else {
				for (i = 0; i < _n; i++) 
				{
					Tweener.addTween(_arr[i], {alpha:1,time:time,delay:dy+wait*i,transition:syle} );
				}
			}
		}
		public static function random_out(mc:Sprite,dy:Number=0,wait:Number=.2,time:Number=.5,blurX:int=30,blurY:int=30,syle:String = "easeOutCubic"):void 
		{
			var _n:int = mc.numChildren;
			var _arr:Array = new Array();
			for (var i:int = 0; i < _n; i++) 
			{
				_arr.push(mc.getChildAt(i));
			}
			_arr = arr_acc.random(_arr);
			if (blurX != 0||blurY != 0)
			{
				
				FilterShortcuts_init();
				for (i = 0; i < _n; i++) 
				{
					Tweener.addTween(_arr[i], {alpha:0,_Blur_blurX:blurX,_Blur_blurY:blurY,_Blur_quality:1,time:time,delay:dy+wait*i,transition:syle} );
				}
			}else {
				for (i = 0; i < _n; i++) 
				{
					Tweener.addTween(_arr[i], {alpha:0,time:time,delay:dy+wait*i,transition:syle} );
				}
			}
		}
	}	
}